﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Security.Principal;
using BAL.EstRec.AUTH;

namespace Nav3
{
    /// <summary>
    /// Lógica de interacción para AuthUserWindows.xaml
    /// </summary>
    public partial class AuthUserWindows : UserControl
    {
        public AuthUserWindows()
        {
            InitializeComponent();
        }

        private void lblUser_Loaded(object sender, RoutedEventArgs e)
        {
            string struser = null;
            System.Security.Principal.WindowsIdentity user = System.Security.Principal.WindowsIdentity.GetCurrent();
            struser = user.Name;
            lblUser.Content = struser;


            lblHQ.Content = Auth.ActualUserTypeControl(user);
            if (Auth.ActualUserTypeControl(user).ToString().Equals("FDV") || Auth.ActualUserTypeControl(user).ToString().Equals("Admin")) {

                labelTerritorio.Content = "Territorio: " + Auth.GetTerritorio().ToString();
                //labelTerritorio.Content = "Territorio: " + 820406;
            }
        }
    }
}
